<script setup lang="ts">

// boolean类型变量
/*let flag: boolean = true;
flag = false;
flag = 100;
console.log(flag);*/

/*// 数值类型变量
let a : number = 1;
console.log(a);*/

// 字符串类型变量
// string类型变量String对应一个类
/*let str: string = "hello";
str = new String("hello");
let aa : String;
aa = "hello";
aa = new String("hello");
console.log(aa);
console.log(str);*/
// 数组类型变量
/*let arr: number[] = [1, 2, 3];
arr = [4, 5, 6];
console.log(arr);*/

//字面量类型
/*let a : 100;
a= 100;
// a = 200;
console.log(a);*/

//任意类型变量
/*let a: any = 100;
a = "hello";
a = true;
a = [1, 2, 3];
a = { name: "张三" };
console.log(a);*/

//未设置变量的类型  为第一次赋的初始值
/*let a = 100;
a = 200;
a = "hello";*/

//未设置变量的类型  为any
/*let a;
a = 100;
a = "hello";
console.log(a);*/

//声明对象类型变量
/*let obj: { name: string; age: number } = {
  name: "张三",
  age: 18,
};
console.log(obj);*/

//声明数值类型数组变量
/*let a: number[] = [1, 2, 3];
console.log(a);
let aa: Array<number> = [1, 2, 3, 4];
console.log(aa);*/

//声明联合类型变量 多种类型变量
/*let a : string | number = "hello";
a = 100;
a = 'aaa';
// a = true;
console.log(a);*/

//类型断言
/*let a : any;
a = 3.14159265359;
// console.log((a as number).toFixed(2));
console.log((<number>a).toFixed(3));*/

/*//类型推断
let a = 100;
console.log(a);*/

</script>

<template>

</template>

<style scoped>

</style>